package com.chauhai.android.batsg.mymap;

import android.graphics.Point;

/**
 * Position on the map.
 *
 * @author umbalaconmeogia
 */
public class Position extends Point {

  public Position(int x, int y) {
    super(x, y);
  }

  public Position(Position position) {
    super(position.x, position.y);
  }

  public Position mult(float ratio) {
    int x = (int) (this.x * ratio);
    int y = (int) (this.y * ratio);
    return new Position(x, y);
  }

  public Position sub(Position position) {
    return new Position(x - position.x, y - position.y);
  }

  public Position add(Position position) {
    return new Position(x + position.x, y + position.y);
  }

  @Override
  public String toString() {
    return "(" + x + ", " + y + ")";
  }
}
